By now, you've walked through PixieDust's intro notebooks and seen PixieDust in action. If you like what you saw, join the project!
Anyone can get involved. Here are some ways you can contribute:
Contribute your own custom visualization. Here's a taste of how it works.
Run the next 4 cells to do the following:
This is just one small example we can quickly do within this notebook. Read how to create a custom visualization.
In [ ]:
import pixiedust
Now, create a simple dataframe:
In [ ]:
sqlContext=SQLContext(sc)
d1 = sqlContext.createDataFrame(
[(2010, 'Camping Equipment', 3),
(2010, 'Golf Equipment', 1),
(2010, 'Mountaineering Equipment', 1),
(2010, 'Outdoor Protection', 2),
(2010, 'Personal Accessories', 2),
(2011, 'Camping Equipment', 4),
(2011, 'Golf Equipment', 5),
(2011, 'Mountaineering Equipment',2),
(2011, 'Outdoor Protection', 4),
(2011, 'Personal Accessories', 2),
(2012, 'Camping Equipment', 5),
(2012, 'Golf Equipment', 5),
(2012, 'Mountaineering Equipment', 3),
(2012, 'Outdoor Protection', 5),
(2012, 'Personal Accessories', 3),
(2013, 'Camping Equipment', 8),
(2013, 'Golf Equipment', 5),
(2013, 'Mountaineering Equipment', 3),
(2013, 'Outdoor Protection', 8),
(2013, 'Personal Accessories', 4)],
["year","zone","unique_customers"])
The following cell creates a new custom table visualization plugin called NewSample:
In [ ]:
from pixiedust.display.display import *
class TestDisplay(Display):
def doRender(self, handlerId):
self._addHTMLTemplateString(
"""
NewSample Plugin
<table class="table table-striped">
<thead>
{%for field in entity.schema.fields%}
<th>{{field.name}}</th>
{%endfor%}
</thead>
<tbody>
{%for row in entity.take(100)%}
<tr>
{%for field in entity.schema.fields%}
<td>{{row[field.name]}}</td>
{%endfor%}
</tr>
{%endfor%}
</tbody>
</table>
"""
)
@PixiedustDisplay()
class TestPluginMeta(DisplayHandlerMeta):
@addId
def getMenuInfo(self,entity,dataHandler):
if entity.__class__.__name__ == "DataFrame":
return [
{"categoryId": "Table", "title": "NewSample Table", "icon": "fa-table", "id": "newsampleTest"}
]
else:
return []
def newDisplayHandler(self,options,entity):
return TestDisplay(options,entity)
Next, run display() to show the data. Click the Table dropdown. You now see NewSample Table option, the custom visualization you just created!
In [ ]:
display(d1)
Error? If you changed the name yourself in cell 3, you may get an error when you try to display. You can fix this by updating metadata in the display() cell. To do so, go to the Jupyter menu above the notebook and choose View > Cell Toolbar > Edit Metadata. Then scroll down to the display(dl)
cell, click its Edit Metadata button and change the handlerID
.
PixieDust lets you switch between renderers for charts and maps. We'd love to add more to the list. It's easy to get started. Try the generate
tool which lets you create a boilerplate renderer using a quick CLI wizard. Read how to build a renderer.
Find a bug? Think of great enhancement? Enter an issue to let us know. Tell us what you think.
Ready to pitch in? We can't wait to see what you share. More on how to contribute.